<?php
namespace App\Mail\SalesReport;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
class SVEFile extends Mailable implements ShouldQueue
{
    use Queueable, SerializesModels;

    protected $filePath;

    /**
     * SVEFile constructor.
     * @param $filePath
     */
    public function __construct($filePath)
    {
        $this->filePath = $filePath;
    }

    /**
     * Build the message.
     *
     * @return $this
     */
    public function build()
    {
        return $this->markdown('emails.sales-report.sve-file')
            ->with(['msg' => '销量报表已生成：'.basename($this->filePath)])
            ->subject('销量报表已生成')
            ->attach($this->filePath);
    }
}
